{template "nheader.html"}
<div class="container-fluid larry-wrapper">

	<section class="panel panel-padding">
		<form class="layui-form" action="" method="post">
			<div class="layui-form">
				<div class="layui-inline">
					<div class="layui-input-inline">
						<input class="layui-input" name="kw" value="{$ip}" placeholder="{dr_lang('搜索IP')}">
					</div>
				</div>
				<div class="layui-inline">
					<button class="layui-btn">{dr_lang('搜索')}</button>
				</div>
			</div>
		</form>
	</section>

	<section class="panel panel-padding">

		<div class="layui-form">
			<div class="table-responsive mytable">
				<form action="" method="post">
					<table class="layui-table lay-even">
						<thead>
						<tr>
							<th width="131" align="left">{dr_lang('时间')}</th>
							<th width="90" align="left">{dr_lang('用户')}</th>
							<th width="90" align="left">{dr_lang('类型')}</th>
							<th width="133" align="left">ip</th>
							<th align="left">{dr_lang('详情')}</th>
						</tr>
						</thead>
						<tbody>
						{loop $list $t}
						<?php
		if ($t['ip'] && $ip && is_array($ip)) {
			if (isset($ip[$t['ip']]) && (empty($ip[$t['ip']]['endtime']) || ($ip[$t['ip']]['endtime'] - $ip[$t['ip']]['addtime']) >= 0)) {
						$t['attack'] = true;
						} else {
						foreach ($ip as $cip=>$test) {
						if (empty($cip) || strpos($cip, '*') === false) continue;
						$preg = '/^' . str_replace(array('*', '.'), array('[0-9]+', '\.'), $cip) . '$/';
						if (preg_match($preg, $t['ip'])) $t['attack'] = true;
						}
						}
						}
						?>
						<tr height="25">
							<td align="left">{date(TIME_FORMAT, $t['time'])}</td>
							<td align="left">{$t['uid']}</td>
							<td align="left">{$t['type']}</td>
							<td align="left"><a href="{dr_url('attack/index', array('ip'=>$t['ip']))}">{$t['ip']}</a></td>
							<td align="left">{htmlspecialchars($t['url'])}</td>
						</tr>
						{/loop}
					</table>

				</form>
			</div>
		</div>


		<div class="text-center" id="page">
			<div class="layui-box layui-laypage layui-laypage-default">
				{$pagelist}
			</div>
		</div>

	</section>

</div>


</body>
<script type="text/javascript" src="{ADMIN_THEME}js/layui/layui.js"></script>
<script>
	layui.config({
		base: '{ADMIN_THEME}js/'
	}).extend({
		echarts: 'lib/echarts',
		ajax: 'jqmodules/ajax',
		modal: 'jqmodules/modal'
	}).use(['main', 'echart']);
</script>
</html>